Skip to content

docs(cf12): plan deterministic impact analysis - #25

Merged
TheHalfMoon merged 6 commits into
mainfrom
docs/cf12-impact-planning
Aug 26, 2026
Merged

docs(cf12): plan deterministic impact analysis#25
TheHalfMoon merged 6 commits into
mainfrom
docs/cf12-impact-planning

Conversation

@TheHalfMoon

Copy link
Copy Markdown
Owner

Summary

Create the Spec Kit planning package for CF-12 commandf impact now that CF-11G is canonically closed.

Scope

Planning only:

  • add specs/013-cf-12-impact/spec.md;
  • add plan.md;
  • add dependency-ordered tasks.md;
  • add consistency.md;
  • freeze the V1 authority boundary: impact is deterministic dependency-exposure evidence, not a compatibility/safety verdict;
  • reuse explicit before/after lock/cache inputs and canonical CF-11G graph evidence;
  • preserve resolved / external / ambiguous semantics fail-closed;
  • require exact multi-version package identity and deterministic shortest evidence paths;
  • define Stack A library work, Stack B CLI/proof work, and final convergence gates.

Canonical base

main: 8f2ce65de3565a81968bb127c96b451f617593c4
CF-11G: CLOSED_CANONICAL

Explicit non-goals

  • no Rust/product implementation;
  • no new crate;
  • no CF-06 or HL7 production-pin change;
  • no frozen CF-10 corpus change;
  • no network canonical resolution;
  • no graph database/vector/AI authority;
  • no SQL-on-FHIR/CQL/SearchParameter/FHIRPath impact parsing in V1.

Keep Draft until exact-head planning CI and independent review are inspected. T004 must close before Stack A implementation begins.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 1 minute.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b6931492-f2e7-4f7a-b823-2c84a4cd716c

📥 Commits

Reviewing files that changed from the base of the PR and between 8f2ce65 and 9e6265b.

📒 Files selected for processing (4)
  • specs/013-cf-12-impact/consistency.md
  • specs/013-cf-12-impact/plan.md
  • specs/013-cf-12-impact/spec.md
  • specs/013-cf-12-impact/tasks.md

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Your Qodo trial ends soon. Ask your workspace admin to set up billing to keep reviews running after the trial. Manage billing

@TheHalfMoon
TheHalfMoon marked this pull request as ready for review August 26, 2026 04:07

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@TheHalfMoon
TheHalfMoon merged commit cefa5e4 into main Aug 26, 2026
5 checks passed
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Plan deterministic CF-12 impact analysis

📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Defines deterministic commandf impact behavior and authority boundaries.
• Plans fail-closed, side-aware traversal over canonical CF-11G evidence.
• Orders library, CLI, proof, and convergence work behind exact-head gates.
Diagram

graph TD
  A["CF-11G Evidence"] --> B["CF-12 Spec"] --> C["Implementation Plan"] --> D["Task Sequence"] --> E["Planning Gate"] --> F["Stack A Library"] --> G["Stack B CLI"] --> H["Convergence Gates"]
Loading
High-Level Assessment

The four-document Spec Kit approach is appropriate because it separates normative behavior, implementation architecture, dependency ordering, and consistency evidence while matching established repository planning conventions. A single consolidated document would reduce file count but weaken review ownership and make lifecycle and gate tracking less explicit.

Files changed (4) +697 / -0

Documentation (4) +697 / -0
consistency.mdRecord CF-12 planning consistency and merge gates +101/-0

Record CF-12 planning consistency and merge gates

• Reconciles the CF-12 package with repository authority documents, CF-11G evidence, and existing CLI conventions. Records planning qualification results, retained implementation risks, explicit deferrals, and the final exact-head merge rule.

specs/013-cf-12-impact/consistency.md

plan.mdDefine the CF-12 implementation and proof strategy +264/-0

Define the CF-12 implementation and proof strategy

• Plans the library-owned impact model, side-aware reverse artifact and package traversal, unresolved-boundary handling, deterministic serialization, and CLI integration. Divides delivery into library, CLI/proof, and optional closeout stacks with explicit trust and acceptance gates.

specs/013-cf-12-impact/plan.md

spec.mdSpecify deterministic impact analysis behavior +231/-0

Specify deterministic impact analysis behavior

• Defines the V1 'commandf impact' contract, including exact before/after evidence, change seeds, reverse dependency exposure, shortest-path normalization, unresolved states, output schema, and acceptance criteria. Explicitly separates impact reachability from compatibility, runtime, safety, or clinical verdicts.

specs/013-cf-12-impact/spec.md

tasks.mdOrder CF-12 planning and implementation tasks +101/-0

Order CF-12 planning and implementation tasks

• Captures completed planning decisions and dependency-orders the future library, CLI, workflow proof, regression, review, and convergence work. Enforces planning merge, fail-closed graph semantics, and authority-boundary sequencing before implementation begins.

specs/013-cf-12-impact/tasks.md

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Required seeds may be unsupported 🐞 Bug ≡ Correctness
Description
The plan allows implementations to emit an unsupported seed when existing diff evidence lacks
canonical identity, but the normative spec requires added, removed, and modified canonical artifacts
to become seeds and has acceptance cases for both additions and removals. This escape hatch is
reachable because current added/removed structural-diff records contain filenames but no artifact
digest, so a conforming implementation could fail valid required cases instead of constructing the
exact graph identity.
Code

specs/013-cf-12-impact/plan.md[76]

+If existing diff evidence cannot establish the required canonical artifact identity, fail closed or retain an explicitly unsupported seed state rather than guessing from filenames. The implementation task must choose one stable behavior and test it before CLI shipping.
Relevance

●●● Strong

Accepted history favors correcting normative documentation gaps; this directly conflicts with
required exact artifact identity and stated add/remove tests.

PR-#18

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The required graph identity includes filename and artifact SHA-256, while added/removed structural
changes are emitted without a digest; therefore the plan's fallback is not merely hypothetical and
conflicts with the mandatory add/remove behavior.

crates/commandf-pkg/src/context_model.rs[17-21]
crates/commandf-pkg/src/artifact_diff_model.rs[53-70]
crates/commandf-pkg/src/artifact_diff.rs[79-95]
crates/commandf-pkg/src/artifact_diff_change.rs[8-24]
specs/013-cf-12-impact/spec.md[55-61]
specs/013-cf-12-impact/spec.md[180-186]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The plan permits an unsupported seed result for valid added or removed canonical artifacts, contradicting the normative seed and acceptance requirements.

## Issue Context
The existing structural-diff report does not carry artifact digests on added/removed records. Define how the CF-12 adapter joins each side's diff record to the verified artifact inventory or Context Graph identity, including deterministic handling of non-unique matches.

## Fix Focus Areas
- specs/013-cf-12-impact/plan.md[64-76]
- specs/013-cf-12-impact/tasks.md[38-40]
- specs/013-cf-12-impact/spec.md[51-61]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Unresolved reverse paths disappear 🐞 Bug ≡ Correctness
Description
The collection algorithm inspects unresolved outgoing edges only after an artifact is already a seed
or resolved-reachable impact, so it omits an otherwise unimpacted source whose ambiguous candidates
include the changed seed. That contradicts the specification's requirement to retain an unresolved
edge that blocks a possible path and leaves the ambiguous-boundary acceptance result dependent on
unrelated resolved reachability.
Code

specs/013-cf-12-impact/plan.md[R106-108]

+For artifacts that are seeds or become impacted, inspect their outgoing CF-11G reference edges.
+
+Retain `external` and `ambiguous` states in a deterministic unresolved-boundary collection. Never insert them into resolved traversal.
Relevance

●●● Strong

The finding identifies a direct contradiction with the specification's explicit unresolved-boundary
requirement; accepted docs corrections are common.

PR-#18

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
CF-11G unresolved edges retain zero or multiple candidates and are never traversed; limiting
collection to already impacted sources therefore cannot find a source connected to the seed only by
an ambiguous candidate, although CF-12 says such blocking evidence must be included.

crates/commandf-pkg/src/context.rs[219-246]
crates/commandf-pkg/src/context_model.rs[62-70]
specs/013-cf-12-impact/spec.md[107-113]
specs/013-cf-12-impact/spec.md[188-190]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The planned boundary pass cannot discover unresolved incoming references from sources that were not reached through resolved traversal.

## Issue Context
Specify a deterministic reverse boundary rule, such as indexing ambiguous candidates and external target keys against each seed/reached node while retaining those entries as non-traversable evidence. Explicitly define which unresolved edges count as blocking a possible path.

## Fix Focus Areas
- specs/013-cf-12-impact/plan.md[104-110]
- specs/013-cf-12-impact/spec.md[105-113]
- specs/013-cf-12-impact/tasks.md[55-57]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Exact subject version undefined 🐞 Bug ≡ Correctness
Description
The frozen CLI accepts only an unspecified package string even though schema-v2 permits multiple
concrete versions of that name and CF-12 requires exact version-aware subject traversal. Following
the cited existing CLI convention selects by name and rejects duplicate same-name entries, so the
documented interface cannot analyze a multi-version lock when the changed subject itself has
multiple versions.
Code

specs/013-cf-12-impact/plan.md[R122-125]

+Add `Impact` to the existing `Command` enum using current CLI conventions:
+
+- positional package identity string;
+- explicit `--before-lock`, `--before-cache`, `--after-lock`, `--after-cache`;
Relevance

●●● Strong

Exact multi-version identity is an explicit frozen scope requirement, so the name-only CLI contract
conflicts with the PR's stated intent.

PR-#10

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Current CLI selection parses a PackageName, filters lock candidates by name, and errors when more
than one remains; the repository's schema-v2 contract explicitly allows same-name concrete versions,
while CF-12 requires exact version-aware reachability.

crates/commandf-cli/src/main.rs[591-603]
crates/commandf-cli/src/main.rs[686-705]
specs/011-cf-11-multi-version-package-graph/spec.md[63-63]
specs/013-cf-12-impact/spec.md[95-103]
specs/013-cf-12-impact/spec.md[196-198]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The CLI contract does not define how the positional subject identifies one concrete package version in each side's multi-version closure.

## Issue Context
Freeze a version-qualified grammar and deterministic before/after matching behavior, or explicitly restrict subject names to one matching package per side and narrow the multi-version requirement accordingly.

## Fix Focus Areas
- specs/013-cf-12-impact/plan.md[120-129]
- specs/013-cf-12-impact/spec.md[21-30]
- specs/013-cf-12-impact/spec.md[93-103]
- specs/013-cf-12-impact/tasks.md[14-17]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 13 rules
Review mode: ⚖️ Balanced

Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

- removed;
- modified with non-empty structural delta.

If existing diff evidence cannot establish the required canonical artifact identity, fail closed or retain an explicitly unsupported seed state rather than guessing from filenames. The implementation task must choose one stable behavior and test it before CLI shipping.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Required seeds may be unsupported 🐞 Bug ≡ Correctness

The plan allows implementations to emit an unsupported seed when existing diff evidence lacks
canonical identity, but the normative spec requires added, removed, and modified canonical artifacts
to become seeds and has acceptance cases for both additions and removals. This escape hatch is
reachable because current added/removed structural-diff records contain filenames but no artifact
digest, so a conforming implementation could fail valid required cases instead of constructing the
exact graph identity.
Agent Prompt
## Issue description
The plan permits an unsupported seed result for valid added or removed canonical artifacts, contradicting the normative seed and acceptance requirements.

## Issue Context
The existing structural-diff report does not carry artifact digests on added/removed records. Define how the CF-12 adapter joins each side's diff record to the verified artifact inventory or Context Graph identity, including deterministic handling of non-unique matches.

## Fix Focus Areas
- specs/013-cf-12-impact/plan.md[64-76]
- specs/013-cf-12-impact/tasks.md[38-40]
- specs/013-cf-12-impact/spec.md[51-61]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +106 to +108
For artifacts that are seeds or become impacted, inspect their outgoing CF-11G reference edges.

Retain `external` and `ambiguous` states in a deterministic unresolved-boundary collection. Never insert them into resolved traversal.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Unresolved reverse paths disappear 🐞 Bug ≡ Correctness

The collection algorithm inspects unresolved outgoing edges only after an artifact is already a seed
or resolved-reachable impact, so it omits an otherwise unimpacted source whose ambiguous candidates
include the changed seed. That contradicts the specification's requirement to retain an unresolved
edge that blocks a possible path and leaves the ambiguous-boundary acceptance result dependent on
unrelated resolved reachability.
Agent Prompt
## Issue description
The planned boundary pass cannot discover unresolved incoming references from sources that were not reached through resolved traversal.

## Issue Context
Specify a deterministic reverse boundary rule, such as indexing ambiguous candidates and external target keys against each seed/reached node while retaining those entries as non-traversable evidence. Explicitly define which unresolved edges count as blocking a possible path.

## Fix Focus Areas
- specs/013-cf-12-impact/plan.md[104-110]
- specs/013-cf-12-impact/spec.md[105-113]
- specs/013-cf-12-impact/tasks.md[55-57]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +122 to +125
Add `Impact` to the existing `Command` enum using current CLI conventions:

- positional package identity string;
- explicit `--before-lock`, `--before-cache`, `--after-lock`, `--after-cache`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

3. Exact subject version undefined 🐞 Bug ≡ Correctness

The frozen CLI accepts only an unspecified package string even though schema-v2 permits multiple
concrete versions of that name and CF-12 requires exact version-aware subject traversal. Following
the cited existing CLI convention selects by name and rejects duplicate same-name entries, so the
documented interface cannot analyze a multi-version lock when the changed subject itself has
multiple versions.
Agent Prompt
## Issue description
The CLI contract does not define how the positional subject identifies one concrete package version in each side's multi-version closure.

## Issue Context
Freeze a version-qualified grammar and deterministic before/after matching behavior, or explicitly restrict subject names to one matching package per side and narrow the multi-version requirement accordingly.

## Fix Focus Areas
- specs/013-cf-12-impact/plan.md[120-129]
- specs/013-cf-12-impact/spec.md[21-30]
- specs/013-cf-12-impact/spec.md[93-103]
- specs/013-cf-12-impact/tasks.md[14-17]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant